<?php

namespace Modules\Chinadmin\Http\Controllers\Admin;

use Modules\Chinadmin\Models\DepartmentModel;
use Modules\Chinadmin\Models\FileDataModel;

class FileData extends Base
{

    /**
     * 依赖注入
     */
    public function __construct(){

        //自行配制
        $this->models = new FileDataModel();

        $this->with = ['p_company','p_department'];

        parent::__construct();

    }


    public function examine(\Illuminate\Http\Request $request){

        $data = $request->input();

        if(isset($data['hide'])){
            $manba['hide'] = 1;
        }
        $Form = FileDataModel::where('id',$data['id'])->first()->toArray();

        $manba['name'] = $Form['name'];
        $manba['type'] = $Form['name'];
        $manba['con'] = $Form['con'];
        $manba['id'] = $Form['id'];

        $Department = DepartmentModel::where('department_id',$Form['department_id'])->first();

        if(empty($Department)){
            $Department['name'] = "";
        }else{
            $Department = $Department->toArray();
        }

        $manba['department'] = $Department['name'];

        return view('chinadmin::admin.' . $this->class . '.examine',$manba);

    }


}
